package com.sa07.control;

import javax.swing.JOptionPane;

import com.sa07.bean.TestSubItem;
import com.sa07.ui.enums.TestResult;

/**
 * 手动测试，主要显示给作业员消息框提示
 * 
 * @author Long.shangbo
 * 
 *         2014-2-18 下午8:55:21
 */
public class CustomTest implements ITest {

	@Override
	public TestResult test(final TestSubItem testItem) {
		if (testItem == null) return TestResult.FAILED;

		TestResult testRes = TestResult.FAILED;
		int option = JOptionPane.showConfirmDialog(null,
				testItem.getSubItemName(), "请确认", JOptionPane.YES_NO_OPTION);

		if (option == JOptionPane.YES_OPTION) {
			testRes = TestResult.SUCCESS;
		} else {
			testRes = TestResult.FAILED;
		}

		return testRes;
	}
}
